<template>
  <div class="app-container">
     <el-form :inline="true" :model="filters" class="demo-form-inline filter-container">
      <el-form-item label="注册时间" prop="dateType">
        <el-date-picker
          v-model="filters.date"
          class="filter-item"
          type="datetimerange"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          value-format="yyyy-MM-dd HH:mm:ss"
          align="right">
        </el-date-picker>
      </el-form-item>

      <el-form-item label="会员账户">
        <el-input v-model="filters.username" style="width: 200px"></el-input>
      </el-form-item>

      <el-form-item label="所属上级">
         <el-input v-model="filters.parentName" style="width: 200px"></el-input>
      </el-form-item>
      <el-button type="primary" v-waves icon="el-icon-search" @click="handleFilter">搜索</el-button>
    </el-form>
  </div>

</template>

<script>
  import {getUserLevelList} from '@/services/api/userLevel'
  import {form, pickerOption} from '@/build'
  import ElRangeInput from "@/components/ElRangeInput/index";

  export default {
    name: "form-filter",
    components: {ElRangeInput},
    mixins: [form, pickerOption],
    data() {

      return {
        filters: {
          date:[moment(consts.ONLINE_DATE).format('YYYY-MM-DD 00:00:00'), moment().format('YYYY-MM-DD 23:59:59')],
          parentName: undefined,
          username: undefined,
          page:1,
          size: 20,
        },
      }
    },
    methods: {
      handleFilter() {
        this.$emit('submit-form', this.filters);
      },
      selfResetForm(formname) {
        this.resetForm(formname)
        this.handleFilter()
      }
    },
    mounted() {

    }
  }
</script>

<style lang="scss" scoped>
  .with-pre-select {
    .el-input-group__prepend {
      .el-select {
        width: 160px;
      }
    }
  }

  .money-range {
    .el-input {
      width: 100px;
    }
  }

</style>
